# -*- coding: iso-8859-2 -*-

import re

class Tagger:
    '''
    Helper class for tagging text
    '''
        
    def __init__(self, name, termList):
        '''
        @param termList
        @param name
        '''
        self.name = name
        self.termList = termList
        
    def tag(self, text):
        '''
        Method checking if any of given tags is included in the text 
        '''
        for term in self.termList:
            if re.search(term + "\s", text, re.IGNORECASE):
                return True
        return False
    
    def getName(self):
        return self.__name

    def getTermList(self):
        return self.__termList
    
    name = property(getName, None, None, None)
    termList = property(getTermList, None, None, None)
    